package com.dtb.trade.entity;

import lombok.Data;

import java.util.List;

/**
 * @Author:ChengJian
 * @Description:
 * @Date: Created in 上午9:59 2018/8/6
 */
@Data
public class Block {

    /**

     * 区块索引号

     */

    private int index;

    /**

     * 当前区块的hash值,区块唯一标识

     */

    private String hash;

    /**

     * 生成区块的时间戳

     */

    private long timestamp;

    /**

     * 当前区块的交易集合

     */

    private List<PointDeal> pointDeals;

    private String data;

    /**

     * 工作量证明，计算正确hash值的次数

     */
    private int nonce;
    /**

     * 前一个区块的hash值

     */

    private String previousHash;

    public Block() {
        super();
    }

    public Block(int index, long timestamp, List<PointDeal> pointDeals, String data, int nonce, String previousHash, String hash) {
        super();
        this.index = index;
        this.timestamp = timestamp;
        this.pointDeals= pointDeals;
        this.nonce = nonce;
        this.previousHash = previousHash;
        this.hash = hash;
    }
}
